home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2000 #5 / Amiga Plus CD - 2000 - No. 5.iso / Tools / Dev / fpc / source / docs / refex / ex83.pp < prev    next >
Encoding:
Text File  |  2000-01-01  |  579 b   |  32 lines

  1. Program example83;
  2.  
  3. { Program to demonstrate the Assigned function }
  4.  
  5. Procedure DoSomething;
  6.  
  7. begin
  8.   Writeln ('Hello from doseomething!')
  9. end;
  10.  
  11. Type 
  12.     TProcType = Procedure;
  13.  
  14. Var P : Pointer;
  15.     Procvar : TProcType;
  16.     
  17. begin
  18.   P:=Nil;
  19.   If not Assigned(P) then 
  20.     Writeln('P is nil');
  21.   Getmem(P,1000);
  22.   If Assigned(P) Then 
  23.     writeln ('P Points in the heap.');
  24.   FreeMem(P,1000);
  25.   procvar:=@DoSomething;
  26.   If Assigned(ProcVar) then 
  27.     Writeln ('Procvar is non-nil');
  28.   procvar:=TProcType(Nil);
  29.   If Not Assigned(Procvar) then
  30.     Writeln ('Procvar is nil');
  31. end.
  32.